#ifndef _H_WINBAR
#define _H_WINBAR

#include "fieldSet.h"
#include "button.h"
#include "toggleButton.h"
#include "label.h"

#define DFT_WBAR_HGT    20
#define DFT_WBAR_MARGIN 3

#define WBAR_NO_BUTTON      0
#define WBAR_CLOSE_BTN      1
#define WBAR_MINI_BTN       2
#define WBAR_LOCK_BTN       4
#define WBAR_CAPTION        8

class barCloseButton: public button{
    public:
        barCloseButton();
        barCloseButton(window*);
        ~barCloseButton();
        void mouseClickEvent(int);
};
class barMinimizeButton: public toggleButton{
    public:
        barMinimizeButton();
        barMinimizeButton(window*);
        ~barMinimizeButton();
        void mouseClickEvent(int);
};
class barLockButton: public toggleButton{
    public:
        barLockButton();
        barLockButton(window*);
        ~barLockButton();
        void mouseClickEvent(int);
};

class frameCloseEvent: public event{
    public:
        frameCloseEvent(winElmt*);
};
class frameMinimizeEvent: public Bevent{
    public:
        frameMinimizeEvent(winElmt*,bool);
};
class frameLockEvent: public Bevent{
    public:
        frameLockEvent(winElmt*,bool);
};

class winBar: public fieldSet{

    protected:
        button* close;
        button* minimize;
        button* lock;
        textDisplay*  caption;

        font*   ft;

        bool dragEnabled;

        unsigned short margin;

    public:
        winBar();
        winBar(window*);
        winBar(unsigned int);
        winBar(window*,unsigned int);
        ~winBar();

        void setCaption(string);
        string getCaption();

        void setFont(font*);

        void setDrag(bool);
        bool getDrag();

        void display();

        void setMode(unsigned int);

        void setParentSet(fieldSet*);

        void draggingEvent(int,int);

        virtual void activeGetEvent();

};

#endif
